<!doctype html>
<html>
<head>
    <!-- <meta charset="UTF-8"> -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{$meta_title}|OneThink管理平台</title>
    <link href="__ROOT__/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="__CSS__/module.css">
    <link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
    <link rel="stylesheet" type="text/css" href="__CSS__/app.css" >    
	<link rel="stylesheet" type="text/css" href="__CSS__/{$Think.config.COLOR_STYLE}.css" media="all">
    <script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="__JS__/jquery.validate.min.js"></script>
      <script type="text/javascript" src="__JS__/messages_zh.js"></script>
      <script type="text/javascript" src="__JS__/portamento.js"></script>
       <script type="text/javascript" src="__JS__/layer/layer.js"></script>
   
</head>
<body>
<style>
.testdiv{
	padding-left: -100px;
	margin-left: -100px;
	height: 100px;
	
}
</style>
    <!-- 头部 ruleinfo-->
   <div class="testdiv">
    	<form  id="myform" action="{:U(ruleedit)}" method="post" accept-charset="utf-8">
		 <div>
			<label >规格名称<span class="check-tips"></span></label>
			
				<input type="text"  class="text input-small" name="rule_name" value="{$ruleinfo.rule_name|default=''}">
			</div>
<div>
			<label >规格价格<span class="check-tips"></span></label>
			
				<input type="text" class="text input-small" name="rule_price" value="{$ruleinfo.rule_price|default=''}">
			</div> <div>
				<label >规格库存<span class="check-tips"></span></label>
			
				<input type="text" class="text input-small" name="stock" value="{$ruleinfo.stock|default=''}">
			</div>
	     <input type="text" class="text input-small" name="rule_id" value="{$ruleinfo.id}">
				  <div class="form-item">
			<input type="hidden" name="id" value="{$info.id|default=''}">
			<button class="btn submit-btn ajax-post" id="ajaxform" type="submit" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
		</form>
</div>
<script>
 // ajax 提交表单
$(document).ready(function(){
    $("#ajaxform").click(function(){    // 提交按钮触发事件
        var tourl = $("#myform").attr("action");    // 获取 表单的 提交地址
        // 序列化 表单数据 后提交 ，太简洁了
        
        var xmlHttpRequest=$.post(tourl,$("form").serialize(),function(data,ts){
					
						//window.location.reload();
						// //$(this).parent().parent().remove();
						// var rule_url2=$(this).attr('href');
						// alert(rule_url2);
						// var aa=$(this).parent().parent().text();
						// alert(aa);
						//
						
       // $.post(tourl,$("form").serialize(),function(data){
        	//alert("bbbccc");
            // data 是 ajaxreturn 返回的 数据
            // layer 插件的方法，只一句话，够简单
            //layer.msg(data['info'], 2, 1);        // 2秒后自动关闭，-1代表不显示图标
            window.parent.location.reload();
             var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
            // parent.location.href="{goodsedit}";
            // parent.layer.close(index); //执行关闭
         
    // parent.$('#parentIframe').text('我被改变了');
    // parent.layer.tips('Look here', '#parentIframe', {time: 5000});
     //parent.layer.location.reload();
     parent.layer.close(index);
//});}
         });
    });
 });
 </script>
</body>
</html>
